import Home from './pages/home';
import Test from './pages/test';
import Second from './pages/second';
import * as React from 'react';
import {HashRouter, Route, Switch} from 'react-router-dom';
import {observer} from "mobx-react";
import './App.scss';
import 'antd/dist/antd.css';
import 'antd/dist/antd.less'
// 提取主页之后的参数 然后获取token
const url = window.location.href
let num = url.indexOf('?')
let str = url.substr(num + 1);
console.log(window.location,'传递')
console.log(str,'token')
sessionStorage.setItem('token',str);
@observer
class App extends React.Component {

    public render() {
        return (
            <HashRouter>
                <Switch>
                    {/*路由规则*/}
                    <Route exact={true} path='/' component={Test} />
                    <Route exact={true} path='/second' component={Second} />
                </Switch>
            </HashRouter>
        );
    }
}

export default App;
